pub mod books {
    use std::cmp::Ordering;
    use std::fmt::{Display, Formatter};

    #[derive(Debug)]
    pub enum BookFormat {
        PaperBack,
        HardBack,
        Ebook,
    }

    pub struct Book {
        pub isbn: i32,
        pub format: BookFormat,
    }

    impl PartialEq for Book {
        fn eq(&self, other: &Self) -> bool {
            return self.isbn == other.isbn;
        }
        fn ne(&self, other: &Self) -> bool {
            return self.isbn != other.isbn;
        }
    }

    impl PartialOrd for Book {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            return if self.isbn == other.isbn {
                Some(Ordering::Equal)
            } else if self.isbn > other.isbn {
                Some(Ordering::Greater)
            } else {
                Some(Ordering::Less)
            };
        }

        fn lt(&self, other: &Self) -> bool {
            return self.isbn < other.isbn;
        }

        fn le(&self, other: &Self) -> bool {
            return self.isbn <= other.isbn;
        }

        fn gt(&self, other: &Self) -> bool {
            return self.isbn > other.isbn;
        }

        fn ge(&self, other: &Self) -> bool {
            return self.isbn >= other.isbn;
        }
    }
    impl Display for Book {
        fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
            write!(f, " display book=({}, {:?})", self.isbn, self.format);
            Ok(())
        }
    }
}
